<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="hello">
        <cpn1></cpn1>
        <cpn2></cpn2>
    </div>
    <!-- 方式1：用script标签 注意type类型 -->
    <script type="text/x-template" id="mycpn">
        <div>
            <h5>组件内容1</h5>
        </div>
    </script>
    <!-- 方式2：用template标签 -->
    <template id="mycpn2">
        <div>
            <h5>组件内容2</h5>
        </div>
    </template>
    <script src="../../vue.js"></script>
    <script>
        const vue01 = new Vue({
            el: '#hello',
            components:{
                cpn1:{
                    // #mycpn 代替了原来的字符串
                    template:'#mycpn',
                },
                cpn2:{
                    template:'#mycpn',
                }
            }
        })
    </script>
</body>

</html>